import { ref } from "vue"
import pageContent from "@/components/page-content";

export function usePageSearch() {
  const pageContentRef = ref<InstanceType<typeof pageContent>>();
  const hanldeSearchBtnClick = (searchInfo: any) => {
    pageContentRef.value?.getPageData(searchInfo);
  };
  // 重置
  const hanldeResetBtnClick = () => {
    pageContentRef.value?.getPageData();
  };

  // return [pageContentRef, hanldeSearchBtnClick, hanldeResetBtnClick]
  return {
    pageContentRef, hanldeSearchBtnClick, hanldeResetBtnClick
  }
}